﻿<Window x:Class="test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="600" Width="800">
    <Window.Resources>        
        <Style TargetType="Button">
            <Setter Property="Margin" Value="3" />
            <Setter Property="Padding" Value="3,1,3,1" />            
        </Style>
    </Window.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" MinHeight="50" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" MinHeight="50"  />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" MinHeight="50" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <TextBlock VerticalAlignment="Center">Source</TextBlock>
            <Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="Generate new source" Click="GenerateNewSourceButton_Click" />
            <DataGrid Grid.Row="1" Name="SourceGrid" ItemsSource="{Binding}" AutoGenerateColumns="True" />
        </Grid>
        <GridSplitter Grid.Row="1" Height="3" HorizontalAlignment="Stretch" Background="Gray"  />
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" VerticalAlignment="Center">Query</TextBlock>
            <TextBox Grid.Row="1" Name="QueryText" AcceptsReturn="True" />
            <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Query" Click="QueryButton_Click" />
        </Grid>
        <GridSplitter Grid.Row="3" Height="3" HorizontalAlignment="Stretch" Background="Gray"  />
        <Grid Grid.Row="4">
            <TabControl Name="ResultTab" TabStripPlacement="Bottom">
                <TabItem Header="Result">
                    <DataGrid Name="ResultGrid" />
                </TabItem>
                <TabItem Header="Error">
                    <DataGrid Name="ErrorGrid" />
                </TabItem>
            </TabControl>
        </Grid>
    </Grid>
</Window>
